﻿/* ==================
 脚本类型:  双倍卡领取NPC	    
 =====================

var 美化1 = "#fUI/ChatBalloon.img/pet/120/nw#";//选择道具
var 美化3 = "#fUI/ChatBalloon.img/pet/120/ne#";//选择道具
var 美化2 = "#fUI/ChatBalloon.img/pet/120/n#";//选择道具
var 美化4 = "#fUI/ChatBalloon.img/pet/120/sw#";//选择道具
var 美化5 = "#fUI/ChatBalloon.img/pet/120/se#";//选择道具
var 美化6 = "#fUI/ChatBalloon.img/pet/120/s#";//选择道具
var 美化7 = "#fUI/ChatBalloon.img/156/arrow#";//选择道具
var status = 0;
var 金币 = "#fUI/UIWindow.img/Item/BtCoin/normal/0#";
var 礼包物品 = "#v2022256#";
 */
var 红色箭头 = "#fUI/UIWindow/Quest/icon6/7#";
var 正方形 = "#fUI/UIWindow/Quest/icon3/6#";
var 蓝色箭头 = "#fUI/UIWindow/Quest/icon2/7#";
function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0) {
            cm.dispose();
            return;
        }
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
            cm.sendSimple("\t\t          #e#d 技能学习 #k#n  #r #b#k#n\r\r\n" + "\r\n#k#n\r\n\t#L2##s1004#骑兽学习#l\n      #L1##s8#群宠学习#l\r\n\t#L0##s1007#锻造学习#l\n     \r\n\r\n " + "#L4#" + 蓝色箭头 + 红色箭头 + " 领取坐骑时装#l");
        } else if (status == 1) {
            switch (selection) {
                case 2:
                    if (cm.getBossLog('骑兽技能') == 1) {
                        cm.sendOk("每个账号只能学习一次技能哦！");
                        cm.dispose();
                    } else {
                        if (cm.getMeso() < 1000000) {
                            cm.sendOk("请检查是否有所需的冒险金币100W。");
                            cm.dispose();
                        } else {
                            cm.gainMeso(-1000000);
                            cm.teachSkill(1004, 1, 1);
                            cm.setBossLog('骑兽技能');
                            cm.sendOk("成功学习了骑兽技能，赶紧去看看吧！");
                            cm.dispose();
                        }
                    }
                    break;
                case 1:
                    if (cm.getBossLog('群宠技能') == 1) {
                        cm.sendOk("每个账号只能学习一次技能哦！");
                        cm.dispose();
                    } else {
                        if (cm.getMeso() < 500000) {
                            cm.sendOk("请检查是否有所需的冒险金币50W。");
                            cm.dispose();
                        } else {
                            cm.gainMeso(-500000);
                            cm.teachSkill(8, 1, 1);
                            cm.setBossLog('群宠技能');
                            cm.sendOk("成功学习了群宠技能，赶紧去看看吧！");
                            cm.dispose();
                        }
                    }
                    break;
                case 0:
                    if (cm.getBossLog('锻造技能') == 1) {
                        cm.sendOk("每个账号只能学习一次技能哦！");
                        cm.dispose();
                    } else {
                        if (cm.getMeso() < 1000000) {
                            cm.sendOk("请检查是否有所需的冒险金币100W。");
                            cm.dispose();
                        } else {
                            cm.gainMeso(-1000000);
                            cm.teachSkill(1007, 3, 1);
                            cm.setBossLog('锻造技能');
                            cm.sendOk("成功学习了锻造技能，赶紧去看看吧！");
                            cm.dispose();
                        }
                    }
                    break;
                case 3:
                    if (cm.getBossLog('皇家骑宠技能') == 1) {
                        cm.sendOk("每个账号只能学习一次技能哦！");
                        cm.dispose();
                    } else {
                        if (cm.getMeso() < 5000) {
                            cm.sendOk("请检查是否有所需的冒险金币。");
                            cm.dispose();
                        } else {
                            cm.gainMeso(-1);
                            cm.teachSkill(1013, 1, 1);
                            cm.setBossLog('皇家骑宠技能');
                            cm.sendOk("成功学习了皇家骑宠技能，赶紧去看看吧！");
                            cm.dispose();
                        }
                    }
                    break;
                case 4:
                    if (cm.getBossLog('坐骑时装') == 1) {
                        cm.sendOk("每个账号只能领取一次");
                        cm.dispose();
                    } else {
                        if (cm.getMeso() < 5000) {
                            cm.sendOk("请检查是否有所需的冒险金币5000。");
                            cm.dispose();
                        } else {
                            randomzuoqi(getRandomInt(1, 3));
                            cm.gainMeso(-5000);
                            cm.setBossLog('坐骑时装');
                            cm.sendOk("领取成功");
                            cm.dispose();
                        }
                    }
                    break;
                case 5:
                    if (cm.haveItem(4032226, 100)) {
                        //cm.gainDY(100);
                        cm.gainvip(+10);
                        cm.gainItem(4032226, -100);
                        cm.sendOk("恭喜你，你提升了10级VIP等级! .");
                        cm.worldMessage(6, "【兑换系统】[" + cm.getName() + "]100只黄金猪猪提升10级VIP等级!成功！");
                        cm.dispose();
                    } else {
                        cm.sendOk("你没有 足够的 黄金猪猪，我不能给你换购~.");
                        cm.dispose();
                    }
                    break;
                case 6:
                    if (cm.haveItem(4001126, 100)) {
                        cm.gainItem(4000313, 10);
                        cm.gainItem(4001126, -100);
                        cm.sendOk("恭喜你，你获得了 10张黄金枫叶! .");
                        cm.worldMessage(6, "【兑换系统】[" + cm.getName() + "]100张枫叶兑换10张黄金枫叶成功！");
                        cm.dispose();
                    } else {
                        cm.sendOk("你没有 足够的 枫叶，我不能给你换购~.");
                        cm.dispose();
                    }
                    break;
                case 7:
                    if (cm.getMeso() >= 10000000) {
                        cm.sendOk("恭喜你，你获得了 2000000 经验值! .");
                        cm.gainMeso(-10000000);
                        cm.gainExp(2000000);
                        cm.dispose();
                    } else {
                        cm.sendOk("你没有 10000000 金币，我不能给你换购~.");
                        cm.dispose();
                    }
                    break;
                case 8:
                    if (cm.getMeso() >= 100000000) {
                        cm.sendOk("恭喜你，你获得了 50000000 经验值! .");
                        cm.gainMeso(-100000000);
                        cm.gainExp(50000000);
                        cm.dispose();
                    } else {
                        cm.sendOk("你没有 1亿 金币，我不能给你换购~.");
                        cm.dispose();
                    }
                    break;
            }
        }
    }
}
var 彩虹 = "#fEffect/ItemEff/1071085/effect/walk1/2#";
var 中条猫 = "#fUI/ChatBalloon/37/n#";
var 猫右 = "#fUI/ChatBalloon/37/ne#";
var 猫左 = "#fUI/ChatBalloon/37/nw#";
var 右 = "#fUI/ChatBalloon/37/e#";
var 左 = "#fUI/ChatBalloon/37/w#";
var 下条猫 = "#fUI/ChatBalloon/37/s#";
var 猫下右 = "#fUI/ChatBalloon/37/se#";
var 猫下左 = "#fUI/ChatBalloon/37/sw#";
function getRandomInt(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min + 1)) + min;
}
function randomzuoqi(number) {
    switch (number) {
        case 1:
            cm.gainItem(1912337, 5, 5, 5, 5, 10, 100, 10, 10, 0, 0, 0, 0, 0, 0, 0);
            cm.gainItem(1902337, 50, 50, 50, 50, 10, 100, 10, 10, 0, 0, 0, 0, 0, 0, 0);
            break;
        case 2:
            cm.gainItem(1912338, 5, 5, 5, 5, 10, 100, 10, 10, 0, 0, 0, 0, 0, 0, 0);
            cm.gainItem(1902338, 50, 50, 50, 50, 10, 100, 10, 10, 0, 0, 0, 0, 0, 0, 0);
            break;
        case 3:
            cm.gainItem(1912340, 5, 5, 5, 5, 10, 100, 10, 10, 0, 0, 0, 0, 0, 0, 0);
            cm.gainItem(1902340, 50, 50, 50, 50, 10, 100, 10, 10, 0, 0, 0, 0, 0, 0, 0);
            break;
        // case 4:
        //     cm.gainItem(1912341,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902341,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 5:
        //     cm.gainItem(1912342,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902342,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 6:
        //     cm.gainItem(1912343,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902343,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 7:
        //     cm.gainItem(1912344,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902344,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 8:
        //     cm.gainItem(1912345,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902345,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 9:
        //     cm.gainItem(1912346,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902346,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 10:
        //     cm.gainItem(1912350,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902350,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 11:
        //     cm.gainItem(1912402,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902402,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 12:
        //     cm.gainItem(1912403,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902403,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 13:
        //     cm.gainItem(1912404,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902404,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 14:
        //     cm.gainItem(1912405,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902405,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 15:
        //     cm.gainItem(1912406,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902406,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 16:
        //     cm.gainItem(1912407,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902407,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;
        // case 17:
        //     cm.gainItem(1912409,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     cm.gainItem(1902409,5,5,5,5,10,100,10,10,0,0,0,0,0,0,0);
        //     break;

    }
}